package com.dingdang.controller.admin.admin;

import com.dingdang.model.AdminLeftNav;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * 后台页面跳转控制类Gasstation
 */
@Controller
@RequestMapping("/admin/third")
public class ThirdViewController {

    //  管理后台登录后首页
    @RequestMapping("thirdIndex")
    public String index(Model model,int index,String openPage) {
        List<AdminLeftNav> allAdminLeftNav5 = new ArrayList<AdminLeftNav>(){{
                    add(new AdminLeftNav("第三方平台", "thirdIndex?index=0&openPage=thirdCenterFirst",0));
                    add(new AdminLeftNav("合伙人", "thirdIndex?index=1&openPage=partner",0));
                    add(new AdminLeftNav("代理商", "thirdIndex?index=2&openPage=agent",0));
                    add(new AdminLeftNav("电商管家", "thirdIndex?index=3&openPage=citic",0));
                    add(new AdminLeftNav("电商管家清分", "thirdIndex?index=4&openPage=citicUploadFile",0));
                }};
        allAdminLeftNav5.get(index).setIsActive(1);
        model.addAttribute("adminLeftNav",allAdminLeftNav5);
        model.addAttribute("openPage", openPage);
        model.addAttribute("isHeadActive", 5);
        return "admin/thirdCenter";
    }

    @RequestMapping("thirdCenterFirst")
    public String thirdCenterFirst() {
        return "admin/third";
    }

    @RequestMapping("partner")
    public String partner() {
        return "admin/partner";
    }

    @RequestMapping("agent")
    public String agent() {
        return "admin/agent";
    }

    @RequestMapping("citic")
    public String citic() {
        return "admin/citic";
    }

    @RequestMapping("citicUploadFile")
    public String citicUploadFile() {
        return "admin/citicUploadFile";
    }

}
